package com.jewelry.crm.model.bo;


import com.jewelry.crm.model.dao.Factory;
import com.jewelry.crm.model.domain.Supplier;
import java.util.Collection;

public class SupplierBo {

    public static void addSupplier(Supplier supplier) throws Throwable {
        Factory.getInstance().getSupplierDao().addSupplier(supplier);
    }

    public static Supplier getSupplierById(Long id) throws Throwable {
        return Factory.getInstance().getSupplierDao().getSupplierById(id);
    }

    public static Supplier getSupplierById(int id) throws Throwable {
        return Factory.getInstance().getSupplierDao().getSupplierById((long) id);
    }

    public static Collection getAllSuppliers() throws Throwable {
        return Factory.getInstance().getSupplierDao().getAllSuppliers();
    }

    public static void deleteSupplier(Supplier supplier) throws Throwable {
        Factory.getInstance().getSupplierDao().deleteSupplier(supplier);
    }

    public static void updateSupplier(Supplier supplier) throws Throwable {
        Factory.getInstance().getSupplierDao().updateSupplier(supplier);
    }
}
